#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
using namespace std;

class Solution 
{
public:
    int firstUniqChar(string s)
    {
        int count[26] = { 0 };
        for (auto ch : s)
        {
            ++count[ch - 97];
        }
        int i = 0;
        for (auto ch : s)
        {
            if (count[ch - 97] == 1)
            {
                return i;
            }
            ++i;
        }

        return -1;
    }
};

int main()
{
    string s1("abcdffsdsfkgsmmvsmvsfkfke");
    cout << s1 << endl;

    Solution ss;
    size_t pos = ss.firstUniqChar(s1);
    cout << pos << endl;
    
    return 0;
}